Type.registerNamespace("AutoCompleteTextBox");

AutoCompleteTextBox.AutoCompleteTextBox = function(element) {
    AutoCompleteTextBox.AutoCompleteTextBox.initializeBase(this, [element]);
    this._SourceID = '';
    this._id = element.id;
};


AutoCompleteTextBox.AutoCompleteTextBox.prototype = {
    initialize: function() {
        var _this = this;
        AutoCompleteTextBox.AutoCompleteTextBox.callBaseMethod(this, 'initialize');
        var selector = "#" + _this._id;

        YUI().use('autocomplete', 'autocomplete-filters', 'autocomplete-highlighters', 'datasource-get', 'gallery - ac - multidelimit', 'gallery - ac -scrollintoview', function(Y) {

            var input = Y.one(selector).plug(Y.Plugin.AutoComplete, eval(_this.get_SourceID()));
        });
    },
    get_SourceID: function() {
        return this._SourceID;
    },
    set_SourceID: function(value) {
        this._SourceID = value;
    }
};
AutoCompleteTextBox.AutoCompleteTextBox.registerClass('AutoCompleteTextBox.AutoCompleteTextBox', Sys.UI.Control);